package main

import (
	"bufio"
	"fmt"
	"net"
	"os"
)

func main() {
	raddr, err := net.ResolveUDPAddr("udp", ":8090")
	if err != nil {
		panic(err)
	}

	laddr := &net.UDPAddr{IP: net.IPv4zero, Port: 9003}

	udp, err := net.DialUDP("udp", laddr, raddr)
	if err != nil {
		panic(err)
	}

	wn, err := udp.Write([]byte("hello, world"))
	if err != nil {
		panic(err)
	}

	fmt.Println(wn)

	reader := bufio.NewReader(os.Stdin)
	_, _, _ = reader.ReadLine()

	wn2, err := udp.Write([]byte("hello, wor"))
	if err != nil {
		panic(err)
	}

	fmt.Println(wn2)
}
